import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router';
import Home from '@/views/Home.vue';
import NotFound from '@/views/NotFound.vue';

const routes: Array<RouteRecordRaw> = [
  // 静态路由
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    //匹配所有路径
    path: '/:pathMatch(.*)*',
    name: 'NotFound',
    component: () =>
      import(/* webpackChunkName: "NotFound" */ '@/views/NotFound.vue')
  }
];

export default createRouter({
  history: createWebHashHistory(),
  routes
});
